package com.dries.portal.module.xxshop.controller;

import com.dries.common.api.CommonResult;
import com.dries.portal.module.xxshop.entity.Shopcheck;
import com.dries.portal.module.xxshop.service.IShopcheckService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Map;

/**
 * 商铺审核
 *
 * @author dries
 * @email samphsanie@gmail.com
 * @date 2020-10-14 14:11:08
 */
@RestController
@RequestMapping("xxshop/shopcheck")
public class ShopcheckController {

    @Resource
    private IShopcheckService shopcheckService;

    /**
     * 列表
     */
    @GetMapping("/list")
    public CommonResult list(@RequestParam Map<String, Object> params){

        
        return CommonResult.success();
    }


    /**
     * 信息
     */
    @GetMapping("/info/{chkid}")
    public CommonResult info(@PathVariable("chkid") Long chkid){
		Shopcheck shopcheck = shopcheckService.getById(chkid);

        return CommonResult.success();
    }

    /**
     * 保存
     */
    @PostMapping("/save")
    public CommonResult save(@RequestBody Shopcheck shopcheck){
		shopcheckService.save(shopcheck);

        return CommonResult.success();
    }

    /**
     * 修改
     */
    @PutMapping("/update")
    public CommonResult update(@RequestBody Shopcheck shopcheck){
		shopcheckService.updateById(shopcheck);

        return CommonResult.success();
    }

    /**
     * 删除
     */
    @DeleteMapping("/delete")
    public CommonResult delete(@RequestBody Long[] chkids){
		shopcheckService.removeByIds(Arrays.asList(chkids));

        return CommonResult.success();
    }

}
